home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / dev / lang / SmallEiffel.lha / SmallEiffel / bin_c / compile_to_jvm9.c < prev    next >
C/C++ Source or Header  |  1998-12-22  |  21KB  |  1,041 lines

  1. /*
  2. -- ANSI C code generated by :
  3. -- SmallEiffel The GNU Eiffel Compiler -- Release (- 0.79)      --
  4. -- Copyright (C), 1994-98 - LORIA - UHP - CRIN - INRIA - FRANCE --
  5. -- Dominique COLNET and Suzanne COLLIN -    colnet@loria.fr     --
  6. --                 http://www.loria.fr/SmallEiffel              --
  7. */
  8. #include "compile_to_jvm.h"
  9.  
  10.  
  11. void r340with_capacity(T340* C,T2 a1,T2 a2){
  12. /*[IF*/
  13. if(((C)->_capacity/*4*/)<(a1)){
  14. C->_storage=calloc(a1,sizeof(T0*));
  15. C->_capacity=a1;
  16. }
  17. /*FI]*/
  18. C->_lower=a2;
  19. C->_upper=(a2)-(1);
  20. }
  21.  
  22.  
  23. void r340add_last(T340* C,T0* a1){
  24. T2 _new_capacity=0;
  25. /*[IF*/
  26. if(((C)->_capacity/*4*/)<((r340count(C))+(1))){
  27. /*[IF*/
  28. if(((C)->_capacity/*4*/)==(0)){
  29. C->_capacity=16;
  30. C->_storage=calloc((C)->_capacity/*4*/,sizeof(T0*));
  31. }
  32. else{
  33. _new_capacity=(2)*((C)->_capacity/*4*/);
  34. C->_storage=r341realloc((C)->_storage/*0*/,(C)->_capacity/*4*/,_new_capacity);
  35. C->_capacity=_new_capacity;
  36. }
  37. /*FI]*/
  38. }
  39. /*FI]*/
  40. C->_upper=((C)->_upper/*8*/)+(1);
  41. /*[IRF3.6put*/{T340* C1=C;
  42. T0* b1=a1;
  43. T2 b2=(C)->_upper/*8*/;
  44. ((C1)->_storage/*0*/)[(b2)-((C1)->_lower/*12*/)]=(b1);
  45. }/*]*/
  46. }
  47.  
  48.  
  49. T0* r340item(T340* C,T2 a1){
  50. T0* R=NULL;
  51. R=((C)->_storage/*0*/)[(a1)-((C)->_lower/*12*/)];
  52. return R;
  53. }
  54.  
  55.  
  56. T6 r340valid_index(T340* C,T2 a1){
  57. T6 R=0;
  58. R=(((C)->_lower/*12*/)<=(a1))&&((a1)<=((C)->_upper/*8*/));
  59. return R;
  60. }
  61.  
  62.  
  63. T0* r340first(T340* C){
  64. T0* R=NULL;
  65. R=r340item(C,(C)->_lower/*12*/);
  66. return R;
  67. }
  68.  
  69.  
  70. T2 r340count(T340* C){
  71. T2 R=0;
  72. R=(((C)->_upper/*8*/)-((C)->_lower/*12*/))+(1);
  73. return R;
  74. }
  75. /*No:ARRAY[RUN_CLASS].lower*/
  76.  
  77.  
  78. T6 r340fast_has(T340* C,T0* a1){
  79. T6 R=0;
  80. R=r340valid_index(C,r340fast_index_of(C,a1));
  81. return R;
  82. }
  83.  
  84.  
  85. T2 r340fast_index_of(T340* C,T0* a1){
  86. T2 R=0;
  87. R=((C)->_lower/*12*/)+(r341fast_index_of((C)->_storage/*0*/,a1,((C)->_upper/*8*/)-((C)->_lower/*12*/)));
  88. return R;
  89. }
  90. /*No:ARRAY[RUN_CLASS].upper*/
  91.  
  92.  
  93. void r340copy(T340* C,T0* a1){
  94. T2 _needed_capacity=0;
  95. C->_lower=(((T340*)a1))->_lower/*12*/;
  96. C->_upper=(((T340*)a1))->_upper/*8*/;
  97. _needed_capacity=(((C)->_upper/*8*/)-((C)->_lower/*12*/))+(1);
  98. /*[IF*/
  99. if(((C)->_capacity/*4*/)<(_needed_capacity)){
  100. C->_capacity=_needed_capacity;
  101. C->_storage=calloc((C)->_capacity/*4*/,sizeof(T0*));
  102. }
  103. /*FI]*/
  104. /*[IF*/
  105. if((_needed_capacity)>(0)){
  106. r341copy_from((C)->_storage/*0*/,(((T340*)a1))->_storage/*0*/,(_needed_capacity)-(1));
  107. }
  108. /*FI]*/
  109. }
  110.  
  111.  
  112. T6 r340empty(T340* C){
  113. T6 R=0;
  114. R=(r340count(C))==(0);
  115. return R;
  116. }
  117. /*No:ARRAY[RUN_CLASS].capacity*/
  118. /*No:ARRAY[RUN_CLASS].put*/
  119. /*No:ARRAY[RUN_CLASS].storage*/
  120.  
  121.  
  122. T0* r108twin(T108* C){
  123. T0* R=NULL;
  124. R=malloc(sizeof(*C));
  125. *((T108*)R)=M108;
  126. r108copy(((T108*)R),((T0*)C));
  127. return R;
  128. }
  129. /*No:ARRAY[ASSERTION].clear_all*/
  130.  
  131.  
  132. void r108add_last(T108* C,T0* a1){
  133. T2 _new_capacity=0;
  134. /*[IF*/
  135. if(((C)->_capacity/*4*/)<((r108count(C))+(1))){
  136. /*[IF*/
  137. if(((C)->_capacity/*4*/)==(0)){
  138. C->_capacity=16;
  139. C->_storage=calloc((C)->_capacity/*4*/,sizeof(T0*));
  140. }
  141. else{
  142. _new_capacity=(2)*((C)->_capacity/*4*/);
  143. C->_storage=r111realloc((C)->_storage/*0*/,(C)->_capacity/*4*/,_new_capacity);
  144. C->_capacity=_new_capacity;
  145. }
  146. /*FI]*/
  147. }
  148. /*FI]*/
  149. C->_upper=((C)->_upper/*8*/)+(1);
  150. /*[IRF3.6put*/{T108* C1=C;
  151. T0* b1=a1;
  152. T2 b2=(C)->_upper/*8*/;
  153. ((C1)->_storage/*0*/)[(b2)-((C1)->_lower/*12*/)]=(b1);
  154. }/*]*/
  155. }
  156. /*No:ARRAY[ASSERTION].set_all_with*/
  157.  
  158.  
  159. T0* r108item(T108* C,T2 a1){
  160. T0* R=NULL;
  161. R=((C)->_storage/*0*/)[(a1)-((C)->_lower/*12*/)];
  162. return R;
  163. }
  164.  
  165.  
  166. T6 r108valid_index(T108* C,T2 a1){
  167. T6 R=0;
  168. R=(((C)->_lower/*12*/)<=(a1))&&((a1)<=((C)->_upper/*8*/));
  169. return R;
  170. }
  171.  
  172.  
  173. T2 r108count(T108* C){
  174. T2 R=0;
  175. R=(((C)->_upper/*8*/)-((C)->_lower/*12*/))+(1);
  176. return R;
  177. }
  178. /*No:ARRAY[ASSERTION].lower*/
  179.  
  180.  
  181. T6 r108fast_has(T108* C,T0* a1){
  182. T6 R=0;
  183. R=r108valid_index(C,r108fast_index_of(C,a1));
  184. return R;
  185. }
  186.  
  187.  
  188. void r108make(T108* C,T2 a1,T2 a2){
  189. T2 _needed=0;
  190. C->_lower=a1;
  191. C->_upper=a2;
  192. _needed=((a2)-(a1))+(1);
  193. /*[IF*/
  194. if((_needed)>(0)){
  195. /*[IF*/
  196. if(((C)->_capacity/*4*/)<(_needed)){
  197. C->_storage=calloc(_needed,sizeof(T0*));
  198. C->_capacity=_needed;
  199. }
  200. else{
  201. /*[IRF3.6clear_all*/{T108* C1=C;
  202. T0* __value=NULL;
  203. /*[IRF3.6set_all_with*/{T108* C2=C1;
  204. T0* c1=__value;
  205. r111set_all_with((C2)->_storage/*0*/,c1,((C2)->_upper/*8*/)-((C2)->_lower/*12*/));
  206. }/*]*/
  207. }/*]*/
  208. }
  209. /*FI]*/
  210. }
  211. /*FI]*/
  212. }
  213.  
  214.  
  215. T2 r108fast_index_of(T108* C,T0* a1){
  216. T2 R=0;
  217. R=((C)->_lower/*12*/)+(r111fast_index_of((C)->_storage/*0*/,a1,((C)->_upper/*8*/)-((C)->_lower/*12*/)));
  218. return R;
  219. }
  220. /*No:ARRAY[ASSERTION].upper*/
  221.  
  222.  
  223. void r108clear(T108* C){
  224. C->_upper=((C)->_lower/*12*/)-(1);
  225. }
  226.  
  227.  
  228. void r108copy(T108* C,T0* a1){
  229. T2 _needed_capacity=0;
  230. C->_lower=(((T108*)a1))->_lower/*12*/;
  231. C->_upper=(((T108*)a1))->_upper/*8*/;
  232. _needed_capacity=(((C)->_upper/*8*/)-((C)->_lower/*12*/))+(1);
  233. /*[IF*/
  234. if(((C)->_capacity/*4*/)<(_needed_capacity)){
  235. C->_capacity=_needed_capacity;
  236. C->_storage=calloc((C)->_capacity/*4*/,sizeof(T0*));
  237. }
  238. /*FI]*/
  239. /*[IF*/
  240. if((_needed_capacity)>(0)){
  241. r111copy_from((C)->_storage/*0*/,(((T108*)a1))->_storage/*0*/,(_needed_capacity)-(1));
  242. }
  243. /*FI]*/
  244. }
  245.  
  246.  
  247. T6 r108empty(T108* C){
  248. T6 R=0;
  249. R=(r108count(C))==(0);
  250. return R;
  251. }
  252. /*No:ARRAY[ASSERTION].capacity*/
  253. /*No:ARRAY[ASSERTION].put*/
  254. /*No:ARRAY[ASSERTION].storage*/
  255.  
  256.  
  257. T0* r242twin(T242* C){
  258. T0* R=NULL;
  259. R=malloc(sizeof(*C));
  260. *((T242*)R)=M242;
  261. r242copy(((T242*)R),((T0*)C));
  262. return R;
  263. }
  264.  
  265.  
  266. void r242add_last(T242* C,T0* a1){
  267. T2 _new_capacity=0;
  268. /*[IF*/
  269. if(((C)->_capacity/*4*/)<((r242count(C))+(1))){
  270. /*[IF*/
  271. if(((C)->_capacity/*4*/)==(0)){
  272. C->_capacity=16;
  273. C->_storage=calloc((C)->_capacity/*4*/,sizeof(T0*));
  274. }
  275. else{
  276. _new_capacity=(2)*((C)->_capacity/*4*/);
  277. C->_storage=r243realloc((C)->_storage/*0*/,(C)->_capacity/*4*/,_new_capacity);
  278. C->_capacity=_new_capacity;
  279. }
  280. /*FI]*/
  281. }
  282. /*FI]*/
  283. C->_upper=((C)->_upper/*8*/)+(1);
  284. /*[IRF3.6put*/{T242* C1=C;
  285. T0* b1=a1;
  286. T2 b2=(C)->_upper/*8*/;
  287. ((C1)->_storage/*0*/)[(b2)-((C1)->_lower/*12*/)]=(b1);
  288. }/*]*/
  289. }
  290.  
  291.  
  292. T0* r242item(T242* C,T2 a1){
  293. T0* R=NULL;
  294. R=((C)->_storage/*0*/)[(a1)-((C)->_lower/*12*/)];
  295. return R;
  296. }
  297.  
  298.  
  299. T2 r242count(T242* C){
  300. T2 R=0;
  301. R=(((C)->_upper/*8*/)-((C)->_lower/*12*/))+(1);
  302. return R;
  303. }
  304. /*No:ARRAY[WHEN_ITEM].lower*/
  305. /*No:ARRAY[WHEN_ITEM].upper*/
  306.  
  307.  
  308. void r242copy(T242* C,T0* a1){
  309. T2 _needed_capacity=0;
  310. C->_lower=(((T242*)a1))->_lower/*12*/;
  311. C->_upper=(((T242*)a1))->_upper/*8*/;
  312. _needed_capacity=(((C)->_upper/*8*/)-((C)->_lower/*12*/))+(1);
  313. /*[IF*/
  314. if(((C)->_capacity/*4*/)<(_needed_capacity)){
  315. C->_capacity=_needed_capacity;
  316. C->_storage=calloc((C)->_capacity/*4*/,sizeof(T0*));
  317. }
  318. /*FI]*/
  319. /*[IF*/
  320. if((_needed_capacity)>(0)){
  321. r243copy_from((C)->_storage/*0*/,(((T242*)a1))->_storage/*0*/,(_needed_capacity)-(1));
  322. }
  323. /*FI]*/
  324. }
  325. /*No:ARRAY[WHEN_ITEM].capacity*/
  326. /*No:ARRAY[WHEN_ITEM].put*/
  327. /*No:ARRAY[WHEN_ITEM].storage*/
  328. /*No:FIXED_ARRAY[DICTIONARY[RUN_FEATURE,STRING]].clear_all*/
  329. /*No:FIXED_ARRAY[DICTIONARY[RUN_FEATURE,STRING]].item*/
  330. /*No:FIXED_ARRAY[DICTIONARY[RUN_FEATURE,STRING]].set_all_with*/
  331. /*No:FIXED_ARRAY[DICTIONARY[RUN_FEATURE,STRING]].count*/
  332.  
  333.  
  334. void r338resize(T338* C,T2 a1){
  335. T0* _elt_default=NULL;
  336. T2 _i=0;
  337. T2 _new_capacity=0;
  338. /*[IF*/
  339. if((a1)<=(/*(IRF4.6count*/((C)->_upper/*8*/)+(1)/*)*/)){
  340. C->_upper=(a1)-(1);
  341. }
  342. else{
  343. _new_capacity=a1;
  344. /*[IF*/
  345. if(((C)->_capacity/*4*/)<(_new_capacity)){
  346. /*[IF*/
  347. if(((C)->_capacity/*4*/)==(0)){
  348. C->_storage=calloc(_new_capacity,sizeof(T0*));
  349. }
  350. else{
  351. C->_storage=r339realloc((C)->_storage/*0*/,(C)->_capacity/*4*/,_new_capacity);
  352. }
  353. /*FI]*/
  354. C->_capacity=_new_capacity;
  355. }
  356. /*FI]*/
  357. _new_capacity=(C)->_upper/*8*/;
  358. C->_upper=(a1)-(1);
  359. _i=(C)->_upper/*8*/;
  360. while (!((_i)==(_new_capacity))) {
  361. /*[IRF3.5put*/((C)->_storage/*0*/)[_i]=(_elt_default);
  362. /*]*/
  363. _i=(_i)-(1);
  364. }
  365. }
  366. /*FI]*/
  367. }
  368.  
  369.  
  370. void r338make(T338* C,T2 a1){
  371. /*[IF*/
  372. if((a1)==(0)){
  373. C->_upper=-(1);
  374. }
  375.  else if(((C)->_capacity/*4*/)==(0)){
  376. C->_storage=calloc(a1,sizeof(T0*));
  377. C->_capacity=a1;
  378. C->_upper=(a1)-(1);
  379. }
  380.  else if(((C)->_capacity/*4*/)<(a1)){
  381. C->_storage=calloc(a1,sizeof(T0*));
  382. C->_capacity=a1;
  383. C->_upper=(a1)-(1);
  384. }
  385. else{
  386. C->_upper=(a1)-(1);
  387. /*[IRF3.6clear_all*/{T338* C1=C;
  388. T0* __value=NULL;
  389. /*[IRF3.6set_all_with*/{T338* C2=C1;
  390. T0* c1=__value;
  391. r339set_all_with((C2)->_storage/*0*/,c1,(C2)->_upper/*8*/);
  392. }/*]*/
  393. }/*]*/
  394. }
  395. /*FI]*/
  396. }
  397. /*No:FIXED_ARRAY[DICTIONARY[RUN_FEATURE,STRING]].upper*/
  398. /*No:FIXED_ARRAY[DICTIONARY[RUN_FEATURE,STRING]].capacity*/
  399. /*No:FIXED_ARRAY[DICTIONARY[RUN_FEATURE,STRING]].put*/
  400. /*No:FIXED_ARRAY[DICTIONARY[RUN_FEATURE,STRING]].storage*/
  401.  
  402.  
  403. void r361with_capacity(T361* C,T2 a1){
  404. /*[IF*/
  405. if(((C)->_capacity/*8*/)<(a1)){
  406. C->_storage=calloc(a1,sizeof(T0*));
  407. C->_capacity=a1;
  408. }
  409. /*FI]*/
  410. C->_upper=-(1);
  411. }
  412.  
  413.  
  414. void r361clear_all(T361* C){
  415. T0* _value=NULL;
  416. /*[IRF3.6set_all_with*/{T361* C1=C;
  417. T0* b1=_value;
  418. r266set_all_with((C1)->_storage/*4*/,b1,(C1)->_upper/*12*/);
  419. }/*]*/
  420. }
  421.  
  422.  
  423. void r361add_last(T361* C,T0* a1){
  424. T2 _new_capacity=0;
  425. /*[IF*/
  426. if((((C)->_upper/*12*/)+(1))<=(((C)->_capacity/*8*/)-(1))){
  427. C->_upper=((C)->_upper/*12*/)+(1);
  428. }
  429.  else if(((C)->_capacity/*8*/)==(0)){
  430. C->_storage=calloc(2,sizeof(T0*));
  431. C->_capacity=2;
  432. C->_upper=0;
  433. }
  434. else{
  435. _new_capacity=(2)*((C)->_capacity/*8*/);
  436. C->_storage=r266realloc((C)->_storage/*4*/,(C)->_capacity/*8*/,_new_capacity);
  437. C->_capacity=_new_capacity;
  438. C->_upper=((C)->_upper/*12*/)+(1);
  439. }
  440. /*FI]*/
  441. /*[IRF3.6put*/{T361* C1=C;
  442. T0* b1=a1;
  443. T2 b2=(C)->_upper/*12*/;
  444. ((C1)->_storage/*4*/)[b2]=(b1);
  445. }/*]*/
  446. }
  447. /*No:FIXED_ARRAY[TYPE].set_all_with*/
  448.  
  449.  
  450. T0* r361item(T361* C,T2 a1){
  451. T0* R=NULL;
  452. R=((C)->_storage/*4*/)[a1];
  453. return R;
  454. }
  455.  
  456.  
  457. T2 r361count(T361* C){
  458. T2 R=0;
  459. R=((C)->_upper/*12*/)+(1);
  460. return R;
  461. }
  462.  
  463.  
  464. void r361resize(T361* C,T2 a1){
  465. T0* _elt_default=NULL;
  466. T2 _i=0;
  467. T2 _new_capacity=0;
  468. /*[IF*/
  469. if((a1)<=(r361count(C))){
  470. C->_upper=(a1)-(1);
  471. }
  472. else{
  473. _new_capacity=a1;
  474. /*[IF*/
  475. if(((C)->_capacity/*8*/)<(_new_capacity)){
  476. /*[IF*/
  477. if(((C)->_capacity/*8*/)==(0)){
  478. C->_storage=calloc(_new_capacity,sizeof(T0*));
  479. }
  480. else{
  481. C->_storage=r266realloc((C)->_storage/*4*/,(C)->_capacity/*8*/,_new_capacity);
  482. }
  483. /*FI]*/
  484. C->_capacity=_new_capacity;
  485. }
  486. /*FI]*/
  487. _new_capacity=(C)->_upper/*12*/;
  488. C->_upper=(a1)-(1);
  489. _i=(C)->_upper/*12*/;
  490. while (!((_i)==(_new_capacity))) {
  491. /*[IRF3.6put*/{T361* C1=C;
  492. T0* b1=_elt_default;
  493. T2 b2=_i;
  494. ((C1)->_storage/*4*/)[b2]=(b1);
  495. }/*]*/
  496. _i=(_i)-(1);
  497. }
  498. }
  499. /*FI]*/
  500. }
  501.  
  502.  
  503. void r361make(T361* C,T2 a1){
  504. /*[IF*/
  505. if((a1)==(0)){
  506. C->_upper=-(1);
  507. }
  508.  else if(((C)->_capacity/*8*/)==(0)){
  509. C->_storage=calloc(a1,sizeof(T0*));
  510. C->_capacity=a1;
  511. C->_upper=(a1)-(1);
  512. }
  513.  else if(((C)->_capacity/*8*/)<(a1)){
  514. C->_storage=calloc(a1,sizeof(T0*));
  515. C->_capacity=a1;
  516. C->_upper=(a1)-(1);
  517. }
  518. else{
  519. C->_upper=(a1)-(1);
  520. r361clear_all(C);
  521. }
  522. /*FI]*/
  523. }
  524. /*No:FIXED_ARRAY[TYPE].upper*/
  525. /*No:FIXED_ARRAY[TYPE].capacity*/
  526. /*No:FIXED_ARRAY[TYPE].put*/
  527. /*No:FIXED_ARRAY[TYPE].storage*/
  528.  
  529.  
  530. void r377with_capacity(T377* C,T2 a1){
  531. /*[IF*/
  532. if(((C)->_capacity/*8*/)<(a1)){
  533. C->_storage=calloc(a1,sizeof(T0*));
  534. C->_capacity=a1;
  535. }
  536. /*FI]*/
  537. C->_upper=-(1);
  538. }
  539.  
  540.  
  541. T0* r377twin(T377* C){
  542. T0* R=NULL;
  543. R=malloc(sizeof(*C));
  544. *((T377*)R)=M377;
  545. r377copy(((T377*)R),((T0*)C));
  546. return R;
  547. }
  548. /*No:FIXED_ARRAY[ADDRESS_OF].clear_all*/
  549.  
  550.  
  551. void r377add_last(T377* C,T0* a1){
  552. T2 _new_capacity=0;
  553. /*[IF*/
  554. if((((C)->_upper/*12*/)+(1))<=(((C)->_capacity/*8*/)-(1))){
  555. C->_upper=((C)->_upper/*12*/)+(1);
  556. }
  557.  else if(((C)->_capacity/*8*/)==(0)){
  558. C->_storage=calloc(2,sizeof(T0*));
  559. C->_capacity=2;
  560. C->_upper=0;
  561. }
  562. else{
  563. _new_capacity=(2)*((C)->_capacity/*8*/);
  564. C->_storage=r378realloc((C)->_storage/*4*/,(C)->_capacity/*8*/,_new_capacity);
  565. C->_capacity=_new_capacity;
  566. C->_upper=((C)->_upper/*12*/)+(1);
  567. }
  568. /*FI]*/
  569. /*[IRF3.5put*/((C)->_storage/*4*/)[(C)->_upper/*12*/]=(a1);
  570. /*]*/
  571. }
  572. /*No:FIXED_ARRAY[ADDRESS_OF].item*/
  573. /*No:FIXED_ARRAY[ADDRESS_OF].set_all_with*/
  574. /*No:FIXED_ARRAY[ADDRESS_OF].count*/
  575.  
  576.  
  577. void r377resize(T377* C,T2 a1){
  578. T0* _elt_default=NULL;
  579. T2 _i=0;
  580. T2 _new_capacity=0;
  581. /*[IF*/
  582. if((a1)<=(/*(IRF4.6count*/((C)->_upper/*12*/)+(1)/*)*/)){
  583. C->_upper=(a1)-(1);
  584. }
  585. else{
  586. _new_capacity=a1;
  587. /*[IF*/
  588. if(((C)->_capacity/*8*/)<(_new_capacity)){
  589. /*[IF*/
  590. if(((C)->_capacity/*8*/)==(0)){
  591. C->_storage=calloc(_new_capacity,sizeof(T0*));
  592. }
  593. else{
  594. C->_storage=r378realloc((C)->_storage/*4*/,(C)->_capacity/*8*/,_new_capacity);
  595. }
  596. /*FI]*/
  597. C->_capacity=_new_capacity;
  598. }
  599. /*FI]*/
  600. _new_capacity=(C)->_upper/*12*/;
  601. C->_upper=(a1)-(1);
  602. _i=(C)->_upper/*12*/;
  603. while (!((_i)==(_new_capacity))) {
  604. /*[IRF3.5put*/((C)->_storage/*4*/)[_i]=(_elt_default);
  605. /*]*/
  606. _i=(_i)-(1);
  607. }
  608. }
  609. /*FI]*/
  610. }
  611.  
  612.  
  613. void r377make(T377* C,T2 a1){
  614. /*[IF*/
  615. if((a1)==(0)){
  616. C->_upper=-(1);
  617. }
  618.  else if(((C)->_capacity/*8*/)==(0)){
  619. C->_storage=calloc(a1,sizeof(T0*));
  620. C->_capacity=a1;
  621. C->_upper=(a1)-(1);
  622. }
  623.  else if(((C)->_capacity/*8*/)<(a1)){
  624. C->_storage=calloc(a1,sizeof(T0*));
  625. C->_capacity=a1;
  626. C->_upper=(a1)-(1);
  627. }
  628. else{
  629. C->_upper=(a1)-(1);
  630. /*[IRF3.6clear_all*/{T377* C1=C;
  631. T0* __value=NULL;
  632. /*[IRF3.6set_all_with*/{T377* C2=C1;
  633. T0* c1=__value;
  634. r378set_all_with((C2)->_storage/*4*/,c1,(C2)->_upper/*12*/);
  635. }/*]*/
  636. }/*]*/
  637. }
  638. /*FI]*/
  639. }
  640. /*No:FIXED_ARRAY[ADDRESS_OF].upper*/
  641.  
  642.  
  643. void r377copy(T377* C,T0* a1){
  644. T2 _new_capacity=0;
  645. T2 _other_upper=0;
  646. _other_upper=(((T377*)a1))->_upper/*12*/;
  647. /*[IF*/
  648. if((_other_upper)>=(0)){
  649. _new_capacity=(_other_upper)+(1);
  650. /*[IF*/
  651. if(((C)->_capacity/*8*/)<(_new_capacity)){
  652. C->_capacity=_new_capacity;
  653. C->_storage=calloc(_new_capacity,sizeof(T0*));
  654. }
  655.  else if(((C)->_capacity/*8*/)>(0)){
  656. r378clear_all((C)->_storage/*4*/,((C)->_capacity/*8*/)-(1));
  657. }
  658. /*FI]*/
  659. r378copy_from((C)->_storage/*4*/,(((T377*)a1))->_storage/*4*/,_other_upper);
  660. }
  661.  else if(((C)->_capacity/*8*/)>(0)){
  662. r378clear_all((C)->_storage/*4*/,((C)->_capacity/*8*/)-(1));
  663. }
  664. /*FI]*/
  665. C->_upper=_other_upper;
  666. }
  667. /*No:FIXED_ARRAY[ADDRESS_OF].capacity*/
  668. /*No:FIXED_ARRAY[ADDRESS_OF].put*/
  669. /*No:FIXED_ARRAY[ADDRESS_OF].storage*/
  670.  
  671.  
  672. void r66with_capacity(T66* C,T2 a1){
  673. /*[IF*/
  674. if(((C)->_capacity/*4*/)<(a1)){
  675. C->_storage=calloc(a1,sizeof(T0*));
  676. C->_capacity=a1;
  677. }
  678. /*FI]*/
  679. C->_upper=-(1);
  680. }
  681. /*No:FIXED_ARRAY[BASE_CLASS].clear_all*/
  682.  
  683.  
  684. void r66add_last(T66* C,T0* a1){
  685. T2 _new_capacity=0;
  686. /*[IF*/
  687. if((((C)->_upper/*8*/)+(1))<=(((C)->_capacity/*4*/)-(1))){
  688. C->_upper=((C)->_upper/*8*/)+(1);
  689. }
  690.  else if(((C)->_capacity/*4*/)==(0)){
  691. C->_storage=calloc(2,sizeof(T0*));
  692. C->_capacity=2;
  693. C->_upper=0;
  694. }
  695. else{
  696. _new_capacity=(2)*((C)->_capacity/*4*/);
  697. C->_storage=r67realloc((C)->_storage/*0*/,(C)->_capacity/*4*/,_new_capacity);
  698. C->_capacity=_new_capacity;
  699. C->_upper=((C)->_upper/*8*/)+(1);
  700. }
  701. /*FI]*/
  702. /*[IRF3.5put*/((C)->_storage/*0*/)[(C)->_upper/*8*/]=(a1);
  703. /*]*/
  704. }
  705. /*No:FIXED_ARRAY[BASE_CLASS].item*/
  706. /*No:FIXED_ARRAY[BASE_CLASS].set_all_with*/
  707.  
  708.  
  709. T6 r66valid_index(T66* C,T2 a1){
  710. T6 R=0;
  711. R=((0)<=(a1))&&((a1)<=((C)->_upper/*8*/));
  712. return R;
  713. }
  714. /*No:FIXED_ARRAY[BASE_CLASS].first*/
  715. /*No:FIXED_ARRAY[BASE_CLASS].count*/
  716. /*No:FIXED_ARRAY[BASE_CLASS].lower*/
  717.  
  718.  
  719. void r66resize(T66* C,T2 a1){
  720. T0* _elt_default=NULL;
  721. T2 _i=0;
  722. T2 _new_capacity=0;
  723. /*[IF*/
  724. if((a1)<=(/*(IRF4.6count*/((C)->_upper/*8*/)+(1)/*)*/)){
  725. C->_upper=(a1)-(1);
  726. }
  727. else{
  728. _new_capacity=a1;
  729. /*[IF*/
  730. if(((C)->_capacity/*4*/)<(_new_capacity)){
  731. /*[IF*/
  732. if(((C)->_capacity/*4*/)==(0)){
  733. C->_storage=calloc(_new_capacity,sizeof(T0*));
  734. }
  735. else{
  736. C->_storage=r67realloc((C)->_storage/*0*/,(C)->_capacity/*4*/,_new_capacity);
  737. }
  738. /*FI]*/
  739. C->_capacity=_new_capacity;
  740. }
  741. /*FI]*/
  742. _new_capacity=(C)->_upper/*8*/;
  743. C->_upper=(a1)-(1);
  744. _i=(C)->_upper/*8*/;
  745. while (!((_i)==(_new_capacity))) {
  746. /*[IRF3.5put*/((C)->_storage/*0*/)[_i]=(_elt_default);
  747. /*]*/
  748. _i=(_i)-(1);
  749. }
  750. }
  751. /*FI]*/
  752. }
  753.  
  754.  
  755. T6 r66fast_has(T66* C,T0* a1){
  756. T6 R=0;
  757. R=r66valid_index(C,r66fast_index_of(C,a1));
  758. return R;
  759. }
  760.  
  761.  
  762. void r66make(T66* C,T2 a1){
  763. /*[IF*/
  764. if((a1)==(0)){
  765. C->_upper=-(1);
  766. }
  767.  else if(((C)->_capacity/*4*/)==(0)){
  768. C->_storage=calloc(a1,sizeof(T0*));
  769. C->_capacity=a1;
  770. C->_upper=(a1)-(1);
  771. }
  772.  else if(((C)->_capacity/*4*/)<(a1)){
  773. C->_storage=calloc(a1,sizeof(T0*));
  774. C->_capacity=a1;
  775. C->_upper=(a1)-(1);
  776. }
  777. else{
  778. C->_upper=(a1)-(1);
  779. /*[IRF3.6clear_all*/{T66* C1=C;
  780. T0* __value=NULL;
  781. /*[IRF3.6set_all_with*/{T66* C2=C1;
  782. T0* c1=__value;
  783. r67set_all_with((C2)->_storage/*0*/,c1,(C2)->_upper/*8*/);
  784. }/*]*/
  785. }/*]*/
  786. }
  787. /*FI]*/
  788. }
  789.  
  790.  
  791. T2 r66fast_index_of(T66* C,T0* a1){
  792. T2 R=0;
  793. R=r67fast_index_of((C)->_storage/*0*/,a1,(C)->_upper/*8*/);
  794. return R;
  795. }
  796. /*No:FIXED_ARRAY[BASE_CLASS].upper*/
  797. /*No:FIXED_ARRAY[BASE_CLASS].clear*/
  798. /*No:FIXED_ARRAY[BASE_CLASS].capacity*/
  799. /*No:FIXED_ARRAY[BASE_CLASS].put*/
  800. /*No:FIXED_ARRAY[BASE_CLASS].storage*/
  801.  
  802.  
  803. void r154with_capacity(T154* C,T2 a1){
  804. /*[IF*/
  805. if(((C)->_capacity/*8*/)<(a1)){
  806. C->_storage=calloc(a1,sizeof(T0*));
  807. C->_capacity=a1;
  808. }
  809. /*FI]*/
  810. C->_upper=-(1);
  811. }
  812.  
  813.  
  814. T0* r154twin(T154* C){
  815. T0* R=NULL;
  816. R=malloc(sizeof(*C));
  817. *((T154*)R)=M154;
  818. r154copy(((T154*)R),((T0*)C));
  819. return R;
  820. }
  821.  
  822.  
  823. void r154clear_all(T154* C){
  824. T0* _value=NULL;
  825. /*[IRF3.6set_all_with*/{T154* C1=C;
  826. T0* b1=_value;
  827. r115set_all_with((C1)->_storage/*4*/,b1,(C1)->_upper/*12*/);
  828. }/*]*/
  829. }
  830.  
  831.  
  832. void r154add_last(T154* C,T0* a1){
  833. T2 _new_capacity=0;
  834. /*[IF*/
  835. if((((C)->_upper/*12*/)+(1))<=(((C)->_capacity/*8*/)-(1))){
  836. C->_upper=((C)->_upper/*12*/)+(1);
  837. }
  838.  else if(((C)->_capacity/*8*/)==(0)){
  839. C->_storage=calloc(2,sizeof(T0*));
  840. C->_capacity=2;
  841. C->_upper=0;
  842. }
  843. else{
  844. _new_capacity=(2)*((C)->_capacity/*8*/);
  845. C->_storage=r115realloc((C)->_storage/*4*/,(C)->_capacity/*8*/,_new_capacity);
  846. C->_capacity=_new_capacity;
  847. C->_upper=((C)->_upper/*12*/)+(1);
  848. }
  849. /*FI]*/
  850. /*[IRF3.6put*/{T154* C1=C;
  851. T0* b1=a1;
  852. T2 b2=(C)->_upper/*12*/;
  853. ((C1)->_storage/*4*/)[b2]=(b1);
  854. }/*]*/
  855. }
  856.  
  857.  
  858. T0* r154item(T154* C,T2 a1){
  859. T0* R=NULL;
  860. R=((C)->_storage/*4*/)[a1];
  861. return R;
  862. }
  863. /*No:FIXED_ARRAY[EXPRESSION].set_all_with*/
  864.  
  865.  
  866. T2 r154count(T154* C){
  867. T2 R=0;
  868. R=((C)->_upper/*12*/)+(1);
  869. return R;
  870. }
  871.  
  872.  
  873. void r154resize(T154* C,T2 a1){
  874. T0* _elt_default=NULL;
  875. T2 _i=0;
  876. T2 _new_capacity=0;
  877. /*[IF*/
  878. if((a1)<=(r154count(C))){
  879. C->_upper=(a1)-(1);
  880. }
  881. else{
  882. _new_capacity=a1;
  883. /*[IF*/
  884. if(((C)->_capacity/*8*/)<(_new_capacity)){
  885. /*[IF*/
  886. if(((C)->_capacity/*8*/)==(0)){
  887. C->_storage=calloc(_new_capacity,sizeof(T0*));
  888. }
  889. else{
  890. C->_storage=r115realloc((C)->_storage/*4*/,(C)->_capacity/*8*/,_new_capacity);
  891. }
  892. /*FI]*/
  893. C->_capacity=_new_capacity;
  894. }
  895. /*FI]*/
  896. _new_capacity=(C)->_upper/*12*/;
  897. C->_upper=(a1)-(1);
  898. _i=(C)->_upper/*12*/;
  899. while (!((_i)==(_new_capacity))) {
  900. /*[IRF3.6put*/{T154* C1=C;
  901. T0* b1=_elt_default;
  902. T2 b2=_i;
  903. ((C1)->_storage/*4*/)[b2]=(b1);
  904. }/*]*/
  905. _i=(_i)-(1);
  906. }
  907. }
  908. /*FI]*/
  909. }
  910.  
  911.  
  912. void r154make(T154* C,T2 a1){
  913. /*[IF*/
  914. if((a1)==(0)){
  915. C->_upper=-(1);
  916. }
  917.  else if(((C)->_capacity/*8*/)==(0)){
  918. C->_storage=calloc(a1,sizeof(T0*));
  919. C->_capacity=a1;
  920. C->_upper=(a1)-(1);
  921. }
  922.  else if(((C)->_capacity/*8*/)<(a1)){
  923. C->_storage=calloc(a1,sizeof(T0*));
  924. C->_capacity=a1;
  925. C->_upper=(a1)-(1);
  926. }
  927. else{
  928. C->_upper=(a1)-(1);
  929. r154clear_all(C);
  930. }
  931. /*FI]*/
  932. }
  933. /*No:FIXED_ARRAY[EXPRESSION].upper*/
  934.  
  935.  
  936. void r154copy(T154* C,T0* a1){
  937. T2 _new_capacity=0;
  938. T2 _other_upper=0;
  939. _other_upper=/*X154upper*/((T2)(((T154*)a1))->_upper/*12*/);
  940. /*[IF*/
  941. if((_other_upper)>=(0)){
  942. _new_capacity=(_other_upper)+(1);
  943. /*[IF*/
  944. if(((C)->_capacity/*8*/)<(_new_capacity)){
  945. C->_capacity=_new_capacity;
  946. C->_storage=calloc(_new_capacity,sizeof(T0*));
  947. }
  948.  else if(((C)->_capacity/*8*/)>(0)){
  949. r115clear_all((C)->_storage/*4*/,((C)->_capacity/*8*/)-(1));
  950. }
  951. /*FI]*/
  952. r115copy_from((C)->_storage/*4*/,/*X154storage*/((T115)(((T154*)a1))->_storage/*4*/),_other_upper);
  953. }
  954.  else if(((C)->_capacity/*8*/)>(0)){
  955. r115clear_all((C)->_storage/*4*/,((C)->_capacity/*8*/)-(1));
  956. }
  957. /*FI]*/
  958. C->_upper=_other_upper;
  959. }
  960. /*No:FIXED_ARRAY[EXPRESSION].capacity*/
  961. /*No:FIXED_ARRAY[EXPRESSION].storage*/
  962. /*No:FIXED_ARRAY[EXPRESSION].put*/
  963.  
  964.  
  965. void r200with_capacity(T200* C,T2 a1){
  966. /*[IF*/
  967. if(((C)->_capacity/*4*/)<(a1)){
  968. C->_storage=calloc(a1,sizeof(T0*));
  969. C->_capacity=a1;
  970. }
  971. /*FI]*/
  972. C->_upper=-(1);
  973. }
  974.  
  975.  
  976. void r200add_last(T200* C,T0* a1){
  977. T2 _new_capacity=0;
  978. /*[IF*/
  979. if((((C)->_upper/*8*/)+(1))<=(((C)->_capacity/*4*/)-(1))){
  980. C->_upper=((C)->_upper/*8*/)+(1);
  981. }
  982.  else if(((C)->_capacity/*4*/)==(0)){
  983. C->_storage=calloc(2,sizeof(T0*));
  984. C->_capacity=2;
  985. C->_upper=0;
  986. }
  987. else{
  988. _new_capacity=(2)*((C)->_capacity/*4*/);
  989. C->_storage=r201realloc((C)->_storage/*0*/,(C)->_capacity/*4*/,_new_capacity);
  990. C->_capacity=_new_capacity;
  991. C->_upper=((C)->_upper/*8*/)+(1);
  992. }
  993. /*FI]*/
  994. /*[IRF3.5put*/((C)->_storage/*0*/)[(C)->_upper/*8*/]=(a1);
  995. /*]*/
  996. }
  997. /*No:FIXED_ARRAY[CLASS_NAME].item*/
  998. /*No:FIXED_ARRAY[CLASS_NAME].upper*/
  999. /*No:FIXED_ARRAY[CLASS_NAME].capacity*/
  1000. /*No:FIXED_ARRAY[CLASS_NAME].storage*/
  1001. /*No:FIXED_ARRAY[CLASS_NAME].put*/
  1002.  
  1003.  
  1004. void r327add_last(T327* C,T0* a1){
  1005. T2 _new_capacity=0;
  1006. /*[IF*/
  1007. if(((C)->_capacity/*4*/)<((r327count(C))+(1))){
  1008. /*[IF*/
  1009. if(((C)->_capacity/*4*/)==(0)){
  1010. C->_capacity=16;
  1011. C->_storage=calloc((C)->_capacity/*4*/,sizeof(T0*));
  1012. }
  1013. else{
  1014. _new_capacity=(2)*((C)->_capacity/*4*/);
  1015. C->_storage=r328realloc((C)->_storage/*0*/,(C)->_capacity/*4*/,_new_capacity);
  1016. C->_capacity=_new_capacity;
  1017. }
  1018. /*FI]*/
  1019. }
  1020. /*FI]*/
  1021. C->_upper=((C)->_upper/*8*/)+(1);
  1022. /*[IRF3.6put*/{T327* C1=C;
  1023. T0* b1=a1;
  1024. T2 b2=(C)->_upper/*8*/;
  1025. ((C1)->_storage/*0*/)[(b2)-((C1)->_lower/*12*/)]=(b1);
  1026. }/*]*/
  1027. }
  1028.  
  1029.  
  1030. T2 r327count(T327* C){
  1031. T2 R=0;
  1032. R=(((C)->_upper/*8*/)-((C)->_lower/*12*/))+(1);
  1033. return R;
  1034. }
  1035. /*No:ARRAY[INDEX_CLAUSE].lower*/
  1036. /*No:ARRAY[INDEX_CLAUSE].upper*/
  1037. /*No:ARRAY[INDEX_CLAUSE].capacity*/
  1038. /*No:ARRAY[INDEX_CLAUSE].put*/
  1039. /*No:ARRAY[INDEX_CLAUSE].storage*/
  1040.  
  1041.